#F0 $0 Space2 add(n1=$0,n2=$1): $0+=$1
(>
>[-<+>]<
<)


#F1 $0 Space2 minus(n1=$0,n2=$1): $0-=$1
+(>
>[-<->]<
<)-


#F2 $1 Space3 not(n=$0): $1=!$0
++(>
>[-]+>[-]<<
[>[-]]>[>]<<
<)--

#F3 $0 Space3 and(n1=$0,n2=$1): x=x&&y
+++(>
>>[-]
<<[>>+<<-]
>>[[-]
	<[>+<-]
	>[<<+>>[-]]
]
<[-]<
<)---

#F4 $0 Space2 or(n1=$0,n2=$1): x=x||y
++++(>
[[-]>+<]
>[[-]<+>]<
<)----

#F5 $0 Space2 xor(n1=$0,n2=$1): x=x^y
#This function has expanded to not equal
+++++(>
[->-<]
>[[-]<+>]<
<)-----

#F6 $0 Space2 xnor(n1=$0,n2=$1): x=!(x^y)
#This function has expanded to equal
++++++(>
[->-<]+
>[[-]<->]<
<)------

#F7 $3 Space4 MUX(a=$0,x=$1,y=$2): $3=(a==0?x:y)
+++++++(>
>>>[-]<<<
[[-]>[-]>[->+<]<<]
>[->>+<<]
>[-]<<
<)-------

#F8 $0 Space5 times(n1=$0,n2=$1): $0*=$1
++++++++(>
>>[-]>[-]>[-]<<<<
[->>+>+<<<]
>[-
	>>[-<<<+>>>]
	<[->+>+<<]
	>>[-<<+>>]<<<
]
>[-]>[-]<<
<)--------


#F9 $1,$2,$3 Space6 divmod(n=$0,d=$1): $1=d-n%d,$2=n%d,$3=n/d
#if d==0 then $0=$1=$2=$3=0
#if d==1 then $0=0,$1=d,$2=0,$3=n
+++++++++(>
>>[-]+>[-]<<[>-]>[>]
<[-<<[-]>>]
<->[-]+>[-]<<[>-]>[>]
<[-<<[->>>+<<<]>>]<+
<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]
<)---------